import $http from '@/assets/js/http'
//设备模块 api

//设备分类列表 
export function deviceCategoryQuery(param){
	return $http.get('/manage/device/category/list',{
		params:{
			pageIndex:param.pageIndex,
			pageSize:param.pageSize
		}
	})
}

//新增设备分类
export function deviceCategoryAdd(param) {
    return $http.post('/manage/device/category/add', {
        name: param.title,
    });
}

//编辑设备分类
export function deviceCategoryEdit(param) {
    return $http.post('/manage/device/category/update', {
    	id: param.id,
        name: param.title,
    });
}

//删除设备分类
export function deviceCategoryDelete(param) {
    return $http.post('/manage/device/category/delete', {
        id: param.delId,
    });
}


//设备评测列表 
export function deviceEvaluateQuery(param){
	return $http.get('/manage/device/evaluate/list',{
		params:{
			title:param.title,
			timeType:param.timeType,
			pageIndex:param.pageIndex,
			pageSize:param.pageSize
		}
	})
}

//新增设备评测
export function deviceEvaluateAdd(param) {
    return $http.post('/manage/device/evaluate/add', {
        title:param.title,
        headImg:param.headImg,
        content:param.content,
        authorize:param.authorize,
        source:param.source,
        keywords:param.keywords,
        
    });
}

//编辑设备评测
export function deviceEvaluateEdit(param) {
    return $http.post('/manage/device/evaluate/update', {
        id:param.id,
        title:param.title,
        headImg:param.headImg,
        content:param.content,
        authorize:param.authorize,
        source:param.source,
        keywords:param.keywords,
        
    });
}

//删除设评测
export function deviceEvaluateDelete(delId) {
    return $http.post('/manage/device/evaluate/delete', {
        id: delId,
    });
}


//设备列表 
export function deviceEquipmentQuery(param){
	return $http.get('/manage/device/list',{
		params:{
            deviceName:param.deviceName,
			pageIndex:param.pageIndex,
			pageSize:param.pageSize
		}
	})
}

//推荐设备-设置推荐
export function deviceEvaluateRecommend(id) {
    return $http.post('/manage/device/recommend/set', {
        ids:id,
        isRecommend:1,
    });
}

//推荐设备-取消推荐
export function deviceEvaluateRecommendChance(id) {
    return $http.post('/manage/device/recommend/set', {
        ids:id,
        isRecommend:0,
    });
}

//删除设备列表的设备
export function exbDelete(param) {
    return $http.get('/manage/device/delete', {
        params:{
            id: param.id,
		}

    });
}

